// Copyright (c) 2020 Presto Labs Pte. Ltd.
// Author: hyuan

#pragma once

#include <memory>
#include <string>
#include <unordered_set>

#include "coin2/exchange/base/order/order.h"
#include "coin2/exchange/deribit_base/api_order/native_private_client.h"

namespace coin2::exchange::deribit_futures::api_order {

class DeribitFuturesRestAsyncAsioSubscriber : public base::order::RestSubscriber {
 public:
  using RestParams = coin2::exchange::order::DeribitFuturesRestParams;
  using RestClient = DeribitFuturesNativePrivateClient;

 public:
  using RestSubscriber::RestSubscriber;
  auto rest_client() { return dynamic_cast<RestClient*>(rest_client_); }
  void GenerateOrRefreshAuth();
  void QueryBalance();
  void QueryAccountSummary(const std::string& currency);
  void QueryPosition(const std::string& currency);
  void QueryOpenOrders(const std::string& native_currency);
  void QueryHistoryOrders(const std::string& native_currency);
  void QueryFills(const std::string& native_currency);
  void SubscribeAsync() override;

  void QueryDeposits(const std::string& currency);
  void QueryWithdrawals(const std::string& currency);
  void QueryTransfers(const std::string& currency);

 private:
  std::unordered_set<std::string> options_supported_currencies_ = {"BTC", "ETH", "USDC"};
};

}  // namespace coin2::exchange::deribit_futures::api_order
